#pragma once


class CBitmapDC :
	public CDC
{
private:
	CBitmap *m_pOldBitmap;
public:
	CBitmapDC(CDC *pDC, CBitmap *pBitmap){
		CreateCompatibleDC(pDC);
		m_pOldBitmap = SelectObject(pBitmap);
	}

	~CBitmapDC(void){
		SelectObject(m_pOldBitmap);
	}
	
	inline CBitmap* SelectBitmap(CBitmap *pBitmap){
		return SelectObject(pBitmap);
	}

	inline void Reset(){
		SelectObject(m_pOldBitmap);
	}
};
